﻿#region Using directives

using System;
using System.Collections.Generic;
using System.Configuration;
using System.Configuration.Provider;
using System.Web.Configuration;
using System.Web;
using VCS.Entities;
using VCS.Data;
using VCS.Data.Bases;

#endregion

namespace VCS.Data
{
	/// <summary>
	/// This class represents the Data source repository and gives access to all the underlying providers.
	/// </summary>
	[CLSCompliant(true)]
	public sealed class DataRepository 
	{
		private static volatile NetTiersProvider _provider = null;
        private static volatile NetTiersProviderCollection _providers = null;
		private static volatile NetTiersServiceSection _section = null;
		private static volatile Configuration _config = null;
        
        private static object SyncRoot = new object();
				
		private DataRepository()
		{
		}
		
		#region Public LoadProvider
		/// <summary>
        /// Enables the DataRepository to programatically create and 
        /// pass in a <c>NetTiersProvider</c> during runtime.
        /// </summary>
        /// <param name="provider">An instatiated NetTiersProvider.</param>
        public static void LoadProvider(NetTiersProvider provider)
        {
			LoadProvider(provider, false);
        }
		
		/// <summary>
        /// Enables the DataRepository to programatically create and 
        /// pass in a <c>NetTiersProvider</c> during runtime.
        /// </summary>
        /// <param name="provider">An instatiated NetTiersProvider.</param>
        /// <param name="setAsDefault">ability to set any valid provider as the default provider for the DataRepository.</param>
		public static void LoadProvider(NetTiersProvider provider, bool setAsDefault)
        {
            if (provider == null)
                throw new ArgumentNullException("provider");

            if (_providers == null)
			{
				lock(SyncRoot)
				{
            		if (_providers == null)
						_providers = new NetTiersProviderCollection();
				}
			}
			
            if (_providers[provider.Name] == null)
            {
                lock (_providers.SyncRoot)
                {
                    _providers.Add(provider);
                }
            }

            if (_provider == null || setAsDefault)
            {
                lock (SyncRoot)
                {
                    if(_provider == null || setAsDefault)
                         _provider = provider;
                }
            }
        }
		#endregion 
		
		///<summary>
		/// Configuration based provider loading, will load the providers on first call.
		///</summary>
		private static void LoadProviders()
        {
            // Avoid claiming lock if providers are already loaded
            if (_provider == null)
            {
                lock (SyncRoot)
                {
                    // Do this again to make sure _provider is still null
                    if (_provider == null)
                    {
                        // Load registered providers and point _provider to the default provider
                        _providers = new NetTiersProviderCollection();

                        ProvidersHelper.InstantiateProviders(NetTiersSection.Providers, _providers, typeof(NetTiersProvider));
						_provider = _providers[NetTiersSection.DefaultProvider];

                        if (_provider == null)
                        {
                            throw new ProviderException("Unable to load default NetTiersProvider");
                        }
                    }
                }
            }
        }

		/// <summary>
        /// Gets the provider.
        /// </summary>
        /// <value>The provider.</value>
        public static NetTiersProvider Provider
        {
            get { LoadProviders(); return _provider; }
        }

		/// <summary>
        /// Gets the provider collection.
        /// </summary>
        /// <value>The providers.</value>
        public static NetTiersProviderCollection Providers
        {
            get { LoadProviders(); return _providers; }
        }
		
		/// <summary>
		/// Creates a new <see cref="TransactionManager"/> instance from the current datasource.
		/// </summary>
		/// <returns></returns>
		public TransactionManager CreateTransaction()
		{
			return _provider.CreateTransaction();
		}

		#region Configuration

		/// <summary>
		/// Gets a reference to the configured NetTiersServiceSection object.
		/// </summary>
		public static NetTiersServiceSection NetTiersSection
		{
			get
			{
				// Try to get a reference to the default <netTiersService> section
				_section = WebConfigurationManager.GetSection("netTiersService") as NetTiersServiceSection;

				if ( _section == null )
				{
					// otherwise look for section based on the assembly name
					_section = WebConfigurationManager.GetSection("VCS.Data") as NetTiersServiceSection;
				}

				#region Design-Time Support

				if ( _section == null )
				{
					// lastly, try to find the specific NetTiersServiceSection for this assembly
					foreach ( ConfigurationSection temp in Configuration.Sections )
					{
						if ( temp is NetTiersServiceSection )
						{
							_section = temp as NetTiersServiceSection;
							break;
						}
					}
				}

				#endregion Design-Time Support
				
				if ( _section == null )
				{
					throw new ProviderException("Unable to load NetTiersServiceSection");
				}

				return _section;
			}
		}

		#region Design-Time Support

		/// <summary>
		/// Gets a reference to the application configuration object.
		/// </summary>
		public static Configuration Configuration
		{
			get
			{
				if ( _config == null )
				{
					// load specific config file
					if ( HttpContext.Current != null )
					{
						_config = WebConfigurationManager.OpenWebConfiguration("~");
					}
					else
					{
						String configFile = AppDomain.CurrentDomain.SetupInformation.ConfigurationFile.Replace(".config", "").Replace(".temp", "");

						// check for design mode
						if ( configFile.ToLower().Contains("devenv.exe") )
						{
							_config = GetDesignTimeConfig();
						}
						else
						{
							_config = ConfigurationManager.OpenExeConfiguration(configFile);
						}
					}
				}

				return _config;
			}
		}

		private static Configuration GetDesignTimeConfig()
		{
			ExeConfigurationFileMap configMap = null;
			Configuration config = null;
			String path = null;

			// Get an instance of the currently running Visual Studio IDE.
			EnvDTE80.DTE2 dte = (EnvDTE80.DTE2) System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");
			
			if ( dte != null )
			{
				dte.SuppressUI = true;

				EnvDTE.ProjectItem item = dte.Solution.FindProjectItem("web.config");
				if ( item != null )
				{
					if (!item.ContainingProject.FullName.ToLower().StartsWith("http:"))
               {
                  System.IO.FileInfo info = new System.IO.FileInfo(item.ContainingProject.FullName);
                  path = String.Format("{0}\\{1}", info.Directory.FullName, item.Name);
                  configMap = new ExeConfigurationFileMap();
                  configMap.ExeConfigFilename = path;
               }
               else
               {
                  configMap = new ExeConfigurationFileMap();
                  configMap.ExeConfigFilename = item.get_FileNames(0);
               }}

				/*
				Array projects = (Array) dte2.ActiveSolutionProjects;
				EnvDTE.Project project = (EnvDTE.Project) projects.GetValue(0);
				System.IO.FileInfo info;

				foreach ( EnvDTE.ProjectItem item in project.ProjectItems )
				{
					if ( String.Compare(item.Name, "web.config", true) == 0 )
					{
						info = new System.IO.FileInfo(project.FullName);
						path = String.Format("{0}\\{1}", info.Directory.FullName, item.Name);
						configMap = new ExeConfigurationFileMap();
						configMap.ExeConfigFilename = path;
						break;
					}
				}
				*/
			}

			config = ConfigurationManager.OpenMappedExeConfiguration(configMap, ConfigurationUserLevel.None);
			return config;
		}

		#endregion Design-Time Support

		#endregion Configuration

		#region Connections

		/// <summary>
		/// Gets a reference to the ConnectionStringSettings collection.
		/// </summary>
		public static ConnectionStringSettingsCollection ConnectionStrings
		{
			get
			{
					// use default ConnectionStrings if _section has already been discovered
					if ( _config == null && _section != null )
					{
						return WebConfigurationManager.ConnectionStrings;
					}
					
					return Configuration.ConnectionStrings.ConnectionStrings;
			}
		}

		// dictionary of connection providers
		private static Dictionary<String, ConnectionProvider> _connections;

		/// <summary>
		/// Gets the dictionary of connection providers.
		/// </summary>
		public static Dictionary<String, ConnectionProvider> Connections
		{
			get
			{
				if ( _connections == null )
				{
					lock (SyncRoot)
                	{
						if (_connections == null)
						{
							_connections = new Dictionary<String, ConnectionProvider>();
		
							// add a connection provider for each configured connection string
							foreach ( ConnectionStringSettings conn in ConnectionStrings )
							{
								_connections.Add(conn.Name, new ConnectionProvider(conn.Name, conn.ConnectionString));
							}
						}
					}
				}

				return _connections;
			}
		}

		/// <summary>
		/// Adds the specified connection string to the map of connection strings.
		/// </summary>
		/// <param name="connectionStringName">The connection string name.</param>
		/// <param name="connectionString">The provider specific connection information.</param>
		public static void AddConnection(String connectionStringName, String connectionString)
		{
			lock (SyncRoot)
            {
				Connections.Remove(connectionStringName);
				ConnectionProvider connection = new ConnectionProvider(connectionStringName, connectionString);
				Connections.Add(connectionStringName, connection);
			}
		}

		/// <summary>
		/// Provides ability to switch connection string at runtime.
		/// </summary>
		public sealed class ConnectionProvider
		{
			private NetTiersProvider _provider;
			private NetTiersProviderCollection _providers;
			private String _connectionStringName;
			private String _connectionString;


			/// <summary>
			/// Initializes a new instance of the ConnectionProvider class.
			/// </summary>
			/// <param name="connectionStringName">The connection string name.</param>
			/// <param name="connectionString">The provider specific connection information.</param>
			public ConnectionProvider(String connectionStringName, String connectionString)
			{
				_connectionString = connectionString;
				_connectionStringName = connectionStringName;
			}

			/// <summary>
			/// Gets the provider.
			/// </summary>
			public NetTiersProvider Provider
			{
				get { LoadProviders(); return _provider; }
			}

			/// <summary>
			/// Gets the provider collection.
			/// </summary>
			public NetTiersProviderCollection Providers
			{
				get { LoadProviders(); return _providers; }
			}

			/// <summary>
			/// Instantiates the configured providers based on the supplied connection string.
			/// </summary>
			private void LoadProviders()
			{
				DataRepository.LoadProviders();

				// Avoid claiming lock if providers are already loaded
				if ( _providers == null )
				{
					lock ( SyncRoot )
					{
						// Do this again to make sure _provider is still null
						if ( _providers == null )
						{
							// apply connection information to each provider
							for ( int i = 0; i < NetTiersSection.Providers.Count; i++ )
							{
								NetTiersSection.Providers[i].Parameters["connectionStringName"] = _connectionStringName;
								// remove previous connection string, if any
								NetTiersSection.Providers[i].Parameters.Remove("connectionString");

								if ( !String.IsNullOrEmpty(_connectionString) )
								{
									NetTiersSection.Providers[i].Parameters["connectionString"] = _connectionString;
								}
							}

							// Load registered providers and point _provider to the default provider
							_providers = new NetTiersProviderCollection();

							ProvidersHelper.InstantiateProviders(NetTiersSection.Providers, _providers, typeof(NetTiersProvider));
							_provider = _providers[NetTiersSection.DefaultProvider];
						}
					}
				}
			}
		}

		#endregion Connections

		#region Static properties
		
		#region PaymentModeProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="PaymentMode"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static PaymentModeProviderBase PaymentModeProvider
		{
			get 
			{
				LoadProviders();
				return _provider.PaymentModeProvider;
			}
		}
		
		#endregion
		
		#region MemberTypeProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="MemberType"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static MemberTypeProviderBase MemberTypeProvider
		{
			get 
			{
				LoadProviders();
				return _provider.MemberTypeProvider;
			}
		}
		
		#endregion
		
		#region ProcedureCategoryProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="ProcedureCategory"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static ProcedureCategoryProviderBase ProcedureCategoryProvider
		{
			get 
			{
				LoadProviders();
				return _provider.ProcedureCategoryProvider;
			}
		}
		
		#endregion
		
		#region MedicalProcedureProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="MedicalProcedure"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static MedicalProcedureProviderBase MedicalProcedureProvider
		{
			get 
			{
				LoadProviders();
				return _provider.MedicalProcedureProvider;
			}
		}
		
		#endregion
		
		#region CompanyProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="Company"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static CompanyProviderBase CompanyProvider
		{
			get 
			{
				LoadProviders();
				return _provider.CompanyProvider;
			}
		}
		
		#endregion
		
		#region CountryProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="Country"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static CountryProviderBase CountryProvider
		{
			get 
			{
				LoadProviders();
				return _provider.CountryProvider;
			}
		}
		
		#endregion
		
		#region InvoiceDetailsProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="InvoiceDetails"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static InvoiceDetailsProviderBase InvoiceDetailsProvider
		{
			get 
			{
				LoadProviders();
				return _provider.InvoiceDetailsProvider;
			}
		}
		
		#endregion
		
		#region PrescriptionDetailProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="PrescriptionDetail"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static PrescriptionDetailProviderBase PrescriptionDetailProvider
		{
			get 
			{
				LoadProviders();
				return _provider.PrescriptionDetailProvider;
			}
		}
		
		#endregion
		
		#region ProcedureDiscountProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="ProcedureDiscount"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static ProcedureDiscountProviderBase ProcedureDiscountProvider
		{
			get 
			{
				LoadProviders();
				return _provider.ProcedureDiscountProvider;
			}
		}
		
		#endregion
		
		#region DoctorProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="Doctor"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static DoctorProviderBase DoctorProvider
		{
			get 
			{
				LoadProviders();
				return _provider.DoctorProvider;
			}
		}
		
		#endregion
		
		#region PatientProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="Patient"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static PatientProviderBase PatientProvider
		{
			get 
			{
				LoadProviders();
				return _provider.PatientProvider;
			}
		}
		
		#endregion
		
		#region ProcedureSubCategoryProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="ProcedureSubCategory"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static ProcedureSubCategoryProviderBase ProcedureSubCategoryProvider
		{
			get 
			{
				LoadProviders();
				return _provider.ProcedureSubCategoryProvider;
			}
		}
		
		#endregion
		
		#region PatientActivationProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="PatientActivation"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static PatientActivationProviderBase PatientActivationProvider
		{
			get 
			{
				LoadProviders();
				return _provider.PatientActivationProvider;
			}
		}
		
		#endregion
		
		#region InvoiceProvider

		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="Invoice"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static InvoiceProviderBase InvoiceProvider
		{
			get 
			{
				LoadProviders();
				return _provider.InvoiceProvider;
			}
		}
		
		#endregion
		
		
		#region AppointmentDoctorProvider
		
		///<summary>
		/// Gets the current instance of the Data Access Logic Component for the <see cref="AppointmentDoctor"/> business entity.
		/// It exposes CRUD methods as well as selecting on index, foreign keys and custom stored procedures.
		///</summary>
		public static AppointmentDoctorProviderBase AppointmentDoctorProvider
		{
			get 
			{
				LoadProviders();
				return _provider.AppointmentDoctorProvider;
			}
		}
		
		#endregion
		
		#endregion
	}
	
	#region Query/Filters
		
	#region PaymentModeFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PaymentMode"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PaymentModeFilters : PaymentModeFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PaymentModeFilters class.
		/// </summary>
		public PaymentModeFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the PaymentModeFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PaymentModeFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PaymentModeFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PaymentModeFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PaymentModeFilters
	
	#region PaymentModeQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="PaymentModeParameterBuilder"/> class
	/// that is used exclusively with a <see cref="PaymentMode"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PaymentModeQuery : PaymentModeParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PaymentModeQuery class.
		/// </summary>
		public PaymentModeQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the PaymentModeQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PaymentModeQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PaymentModeQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PaymentModeQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PaymentModeQuery
		
	#region MemberTypeFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="MemberType"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class MemberTypeFilters : MemberTypeFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the MemberTypeFilters class.
		/// </summary>
		public MemberTypeFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the MemberTypeFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public MemberTypeFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the MemberTypeFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public MemberTypeFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion MemberTypeFilters
	
	#region MemberTypeQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="MemberTypeParameterBuilder"/> class
	/// that is used exclusively with a <see cref="MemberType"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class MemberTypeQuery : MemberTypeParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the MemberTypeQuery class.
		/// </summary>
		public MemberTypeQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the MemberTypeQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public MemberTypeQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the MemberTypeQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public MemberTypeQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion MemberTypeQuery
		
	#region ProcedureCategoryFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="ProcedureCategory"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class ProcedureCategoryFilters : ProcedureCategoryFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the ProcedureCategoryFilters class.
		/// </summary>
		public ProcedureCategoryFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the ProcedureCategoryFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public ProcedureCategoryFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the ProcedureCategoryFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public ProcedureCategoryFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion ProcedureCategoryFilters
	
	#region ProcedureCategoryQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ProcedureCategoryParameterBuilder"/> class
	/// that is used exclusively with a <see cref="ProcedureCategory"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class ProcedureCategoryQuery : ProcedureCategoryParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the ProcedureCategoryQuery class.
		/// </summary>
		public ProcedureCategoryQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the ProcedureCategoryQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public ProcedureCategoryQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the ProcedureCategoryQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public ProcedureCategoryQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion ProcedureCategoryQuery
		
	#region MedicalProcedureFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="MedicalProcedure"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class MedicalProcedureFilters : MedicalProcedureFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the MedicalProcedureFilters class.
		/// </summary>
		public MedicalProcedureFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the MedicalProcedureFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public MedicalProcedureFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the MedicalProcedureFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public MedicalProcedureFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion MedicalProcedureFilters
	
	#region MedicalProcedureQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="MedicalProcedureParameterBuilder"/> class
	/// that is used exclusively with a <see cref="MedicalProcedure"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class MedicalProcedureQuery : MedicalProcedureParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the MedicalProcedureQuery class.
		/// </summary>
		public MedicalProcedureQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the MedicalProcedureQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public MedicalProcedureQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the MedicalProcedureQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public MedicalProcedureQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion MedicalProcedureQuery
		
	#region CompanyFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Company"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class CompanyFilters : CompanyFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CompanyFilters class.
		/// </summary>
		public CompanyFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the CompanyFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public CompanyFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the CompanyFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public CompanyFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion CompanyFilters
	
	#region CompanyQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="CompanyParameterBuilder"/> class
	/// that is used exclusively with a <see cref="Company"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class CompanyQuery : CompanyParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CompanyQuery class.
		/// </summary>
		public CompanyQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the CompanyQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public CompanyQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the CompanyQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public CompanyQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion CompanyQuery
		
	#region CountryFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Country"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class CountryFilters : CountryFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CountryFilters class.
		/// </summary>
		public CountryFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the CountryFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public CountryFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the CountryFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public CountryFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion CountryFilters
	
	#region CountryQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="CountryParameterBuilder"/> class
	/// that is used exclusively with a <see cref="Country"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class CountryQuery : CountryParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the CountryQuery class.
		/// </summary>
		public CountryQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the CountryQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public CountryQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the CountryQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public CountryQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion CountryQuery
		
	#region InvoiceDetailsFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="InvoiceDetails"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class InvoiceDetailsFilters : InvoiceDetailsFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the InvoiceDetailsFilters class.
		/// </summary>
		public InvoiceDetailsFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the InvoiceDetailsFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public InvoiceDetailsFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the InvoiceDetailsFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public InvoiceDetailsFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion InvoiceDetailsFilters
	
	#region InvoiceDetailsQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="InvoiceDetailsParameterBuilder"/> class
	/// that is used exclusively with a <see cref="InvoiceDetails"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class InvoiceDetailsQuery : InvoiceDetailsParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the InvoiceDetailsQuery class.
		/// </summary>
		public InvoiceDetailsQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the InvoiceDetailsQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public InvoiceDetailsQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the InvoiceDetailsQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public InvoiceDetailsQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion InvoiceDetailsQuery
		
	#region PrescriptionDetailFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PrescriptionDetail"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PrescriptionDetailFilters : PrescriptionDetailFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PrescriptionDetailFilters class.
		/// </summary>
		public PrescriptionDetailFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the PrescriptionDetailFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PrescriptionDetailFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PrescriptionDetailFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PrescriptionDetailFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PrescriptionDetailFilters
	
	#region PrescriptionDetailQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="PrescriptionDetailParameterBuilder"/> class
	/// that is used exclusively with a <see cref="PrescriptionDetail"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PrescriptionDetailQuery : PrescriptionDetailParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PrescriptionDetailQuery class.
		/// </summary>
		public PrescriptionDetailQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the PrescriptionDetailQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PrescriptionDetailQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PrescriptionDetailQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PrescriptionDetailQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PrescriptionDetailQuery
		
	#region ProcedureDiscountFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="ProcedureDiscount"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class ProcedureDiscountFilters : ProcedureDiscountFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the ProcedureDiscountFilters class.
		/// </summary>
		public ProcedureDiscountFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the ProcedureDiscountFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public ProcedureDiscountFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the ProcedureDiscountFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public ProcedureDiscountFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion ProcedureDiscountFilters
	
	#region ProcedureDiscountQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ProcedureDiscountParameterBuilder"/> class
	/// that is used exclusively with a <see cref="ProcedureDiscount"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class ProcedureDiscountQuery : ProcedureDiscountParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the ProcedureDiscountQuery class.
		/// </summary>
		public ProcedureDiscountQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the ProcedureDiscountQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public ProcedureDiscountQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the ProcedureDiscountQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public ProcedureDiscountQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion ProcedureDiscountQuery
		
	#region DoctorFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Doctor"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class DoctorFilters : DoctorFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DoctorFilters class.
		/// </summary>
		public DoctorFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the DoctorFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public DoctorFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the DoctorFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public DoctorFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion DoctorFilters
	
	#region DoctorQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="DoctorParameterBuilder"/> class
	/// that is used exclusively with a <see cref="Doctor"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class DoctorQuery : DoctorParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the DoctorQuery class.
		/// </summary>
		public DoctorQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the DoctorQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public DoctorQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the DoctorQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public DoctorQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion DoctorQuery
		
	#region PatientFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Patient"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatientFilters : PatientFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatientFilters class.
		/// </summary>
		public PatientFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatientFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatientFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatientFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatientFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatientFilters
	
	#region PatientQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="PatientParameterBuilder"/> class
	/// that is used exclusively with a <see cref="Patient"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatientQuery : PatientParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatientQuery class.
		/// </summary>
		public PatientQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatientQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatientQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatientQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatientQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatientQuery
		
	#region ProcedureSubCategoryFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="ProcedureSubCategory"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class ProcedureSubCategoryFilters : ProcedureSubCategoryFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the ProcedureSubCategoryFilters class.
		/// </summary>
		public ProcedureSubCategoryFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the ProcedureSubCategoryFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public ProcedureSubCategoryFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the ProcedureSubCategoryFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public ProcedureSubCategoryFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion ProcedureSubCategoryFilters
	
	#region ProcedureSubCategoryQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="ProcedureSubCategoryParameterBuilder"/> class
	/// that is used exclusively with a <see cref="ProcedureSubCategory"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class ProcedureSubCategoryQuery : ProcedureSubCategoryParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the ProcedureSubCategoryQuery class.
		/// </summary>
		public ProcedureSubCategoryQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the ProcedureSubCategoryQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public ProcedureSubCategoryQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the ProcedureSubCategoryQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public ProcedureSubCategoryQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion ProcedureSubCategoryQuery
		
	#region PatientActivationFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="PatientActivation"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatientActivationFilters : PatientActivationFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatientActivationFilters class.
		/// </summary>
		public PatientActivationFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatientActivationFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatientActivationFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatientActivationFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatientActivationFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatientActivationFilters
	
	#region PatientActivationQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="PatientActivationParameterBuilder"/> class
	/// that is used exclusively with a <see cref="PatientActivation"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class PatientActivationQuery : PatientActivationParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the PatientActivationQuery class.
		/// </summary>
		public PatientActivationQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the PatientActivationQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public PatientActivationQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the PatientActivationQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public PatientActivationQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion PatientActivationQuery
		
	#region InvoiceFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="Invoice"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class InvoiceFilters : InvoiceFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the InvoiceFilters class.
		/// </summary>
		public InvoiceFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the InvoiceFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public InvoiceFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the InvoiceFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public InvoiceFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion InvoiceFilters
	
	#region InvoiceQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="InvoiceParameterBuilder"/> class
	/// that is used exclusively with a <see cref="Invoice"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class InvoiceQuery : InvoiceParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the InvoiceQuery class.
		/// </summary>
		public InvoiceQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the InvoiceQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public InvoiceQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the InvoiceQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public InvoiceQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion InvoiceQuery
		
	#region AppointmentDoctorFilters
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="SqlFilterBuilder&lt;EntityColumn&gt;"/> class
	/// that is used exclusively with a <see cref="AppointmentDoctor"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class AppointmentDoctorFilters : AppointmentDoctorFilterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the AppointmentDoctorFilters class.
		/// </summary>
		public AppointmentDoctorFilters() : base() { }

		/// <summary>
		/// Initializes a new instance of the AppointmentDoctorFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public AppointmentDoctorFilters(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the AppointmentDoctorFilters class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public AppointmentDoctorFilters(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion AppointmentDoctorFilters
	
	#region AppointmentDoctorQuery
	
	/// <summary>
	/// A strongly-typed instance of the <see cref="AppointmentDoctorParameterBuilder"/> class
	/// that is used exclusively with a <see cref="AppointmentDoctor"/> object.
	/// </summary>
	[CLSCompliant(true)]
	public class AppointmentDoctorQuery : AppointmentDoctorParameterBuilder
	{
		#region Constructors

		/// <summary>
		/// Initializes a new instance of the AppointmentDoctorQuery class.
		/// </summary>
		public AppointmentDoctorQuery() : base() { }

		/// <summary>
		/// Initializes a new instance of the AppointmentDoctorQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		public AppointmentDoctorQuery(bool ignoreCase) : base(ignoreCase) { }

		/// <summary>
		/// Initializes a new instance of the AppointmentDoctorQuery class.
		/// </summary>
		/// <param name="ignoreCase">Specifies whether to create case-insensitive statements.</param>
		/// <param name="useAnd">Specifies whether to combine statements using AND or OR.</param>
		public AppointmentDoctorQuery(bool ignoreCase, bool useAnd) : base(ignoreCase, useAnd) { }

		#endregion Constructors
	}

	#endregion AppointmentDoctorQuery
	#endregion

	
}
